﻿//反馈建议
var formaterTest = function (elCell, oRecord, oColumn, sData) {
    elCell.innerHTML = oRecord.getData("jynr").substring(0, 30);
}

var formaterContent1 = function (elCell, oRecord, oColumn, sData) {
    elCell.innerHTML = oRecord.getData("content1").substring(0, 30);
}

var userReply = function (elCell, oRecord, oColumn, sData) {
    var ID = oRecord.getData("ID");
    var UserID = oRecord.getData("AddUser")
    //parent.addTabs(pagetitle, encodeURI("../EHR/MsgReplyPage.aspx?r=" + Math.random() + "&id=" + ID +"&UserID="+UserID+""));
    elCell.innerHTML = "<a href='javascript:transForForm(\"点击回复\",\"../EHR/MsgReplyPage.aspx?r=" + Math.random() + "&id=" + ID + "&UserID=" + UserID + "\");'>点击回复</a><br />";

    //    var WorkFlowInstanceId = oRecord.getData("WorkFlowInstanceId");
    //    var workflowId = oRecord.getData("WorkFlowId");
    //    var taskCaption = oRecord.getData("TaskCaption");
    //    var url = '"' + "../../Crm/BasePages/WorkflowMap.aspx?WorkFlowInstanceId=" + WorkFlowInstanceId + "&workflowId=" + workflowId + '"';
    //    var title = '"' + taskCaption + '流程图"';
    //    elCell.innerHTML = "<a href='javascript:transForForm(" + title + "," + url + ")'>流程图</a><br />";
}

var transForForm = function (title, url) {
    parent.addTabs(title, url);
    parent.NeedRefreshPage = this;
}


//删除
var fnCustomDelete = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }


    var const_EditEntity = "DatSysNewsMonth";

    var list = mDataTable.getRecordSet()._records;
    var elist = [];
    dl = [];
    for (var i = 0; i < list.length; i++) {
        if (list[i]._oData["iSun_Selected"] == true) {
            elist.push(list[i]._oData[const_entityID]);
            dl.push(list[i]._sId); //获取行ID；
        }
    }

    SaveUrl = "../Extend/AjaxData/DataSave.aspx?r=" + Math.random() + "&action=delete&entity=" + const_EditEntity + "&id=" + record.getData(const_entityID);
    YAHOO.example.container.dialog3.show();
}